package com.wzy.netty.core.inboundhandlerandoutboundhandler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * 描述  :
 * 创建人:    Wzy
 * 创建时间: 2020-06-11  23:13
 */
public class MyClientHandel extends SimpleChannelInboundHandler<Long> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, Long aLong) throws Exception {
        System.out.println("服务器ip=" + channelHandlerContext.channel().remoteAddress() + ">>" + aLong);
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        System.out.println("MyClientHandel 发送数据");
//        ctx.writeAndFlush(Unpooled)
        ctx.writeAndFlush(123456L);
    }

}
